package com.lys.emsystem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lys.emsystem.mapper.SchoolMapper;

import com.lys.emsystem.entity.School;
import com.lys.emsystem.service.SchoolService;
import com.lys.emsystem.vo.SchoolVo;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class SchoolServiceImpl implements SchoolService {

    @Autowired
    private SchoolMapper schoolMapper;


    @Override
    public List<School> selectList() {
        return schoolMapper.selectLists();
    }

    @Override
    public IPage<School> selectByNameOrNo(Page<School> page, SchoolVo schoolVo) {
        return schoolMapper.selectByNameOrNo(page,schoolVo);
    }

    @Override
    public int addSchool(School school) {
        return schoolMapper.insert(school);
    }

    @Override
    public int updateSchool(School school) {
        return schoolMapper.updateById(school);
    }

    @Override
    public int deleteSchool(int schoolId) {
        return schoolMapper.deleteById(schoolId);
    }

    @Override
    public int deleteSchools(int[] ids) {
        return schoolMapper.deleteSchools(ids);
    }
}
